#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#include<dos.h>
void main()
{
clrscr();
int gd=DETECT,gm,r,x,y;
float d;

initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
scanf("%d",&r);
x=0;
y=r;
d=3-2*r;
do
{
putpixel(200+x,200+y,15);
putpixel(200+y,200+x,15);
putpixel(200+y,200-x,15);
putpixel(200+x,200-y,15);
putpixel(200-y,200+x,15);
putpixel(200-x,200-y,15);
putpixel(200-y,200-x,15);
putpixel(200-x,200+y,15);

if(d<=0)
{
d=d+4*x+6;
}
else
{
d=d+4*(x-y)+10;
y=y-1;
}
x=x+1;
delay(1000);
}

	    while(x<y);

getch();
closegraph();
}


